package com.example.novelsys.dao;
//会员用户的持久CRUD


import com.example.novelsys.entity.Users;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserDao {

	
	//注册用户
	@Insert("insert into users (userId,userName,pwd,email) values (null, #{userName}, #{pwd}, #{email})")
    public int addUser(Users user);


	//根据用户名  查询用户信息
	@Select("select * from users  where username=#{username} ")
	public List<Users> queryByName(String username);

	//根据用户id查询用户信息
	@Select("select * from users where userId=#{userId} ")
	public Users queryByKey(Long userId);
}
